// 用户管理
<template>
  <div class="mainarea">
    <!-- 全局注册 table 组件 -->
    <BaseTable :columnList="columnList"
               :indexId="true"
               :url="url"></BaseTable>
  </div>
</template>

<script>
export default {
  data: function () {
    return {
      // 表格动态列
      columnList: [
        { label: 'id', prop: 'id', element: 'el-input', primarykey: true, hidden: true },
        { label: 'usermanage.userName', prop: 'username', element: 'el-input' },
        { label: '账号', prop: 'userCode', element: 'el-input' },
        { label: '身份证号码', prop: 'idcard', element: 'el-input' },
        { label: '性别', prop: 'gender', element: 'el-input', width: '70' },
        { label: '年龄', prop: 'age', element: 'el-input', width: '70' },
        { label: '密码', prop: 'password', element: 'el-input' },
        { label: '角色', prop: 'role', element: 'el-input' },
        { label: '电话号码', prop: 'phone', element: 'el-input' },
        { label: '地址', prop: 'address', element: 'el-input' },
        { label: '邮箱', prop: 'email', element: 'el-input' }
      ],
      // 工具栏对应的 url
      url: {
        page: { url: '/user/page', module: 'core', type: 'post' },
        delete: { url: '/user/delete', module: 'core', type: 'post', deletekey: 'id' },
        insert: { url: '/user/insert', module: 'core', type: 'post' }
      }
    }
  },
  computed: {

  },
  methods: {
    // 初始化参数
    initPageParam () {
      this.url.page.param = { userid: this.$backutils.user().id }
    }

  },
  created () {
    this.initPageParam()
  }
}
</script>

<style scoped>
/* .mainarea {
  padding: 4px;
} */
</style>
